<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改支付商费率')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-channelRate-edit" th:object="${channelRate}">
            <input id="rateId" name="rateId" th:field="*{rateId}"  type="hidden">
			<div class="form-group">
				<label class="col-sm-3 control-label">支付类型：</label>
				<div class="col-sm-8">
					<div class="input-group" style="width: 100%">
						<select name="payType" class="form-control m-b" th:with="type=${@dict.getType('sys_channel_type')}">
							<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{payType}"></option>
						</select>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label"><span style="color: red; ">*</span>费率(如:千分2填写0.002)：</label>
				<div class="col-sm-8">
					<input name="payRate" type="number" class="form-control required" th:field="*{payRate}" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">状态：</label>
				<div class="col-sm-8">
					<div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
						<input type="radio" th:id="${dict.dictCode}" name="useStatus" th:value="${dict.dictValue}" th:field="*{useStatus}" th:checked="${dict.isDefault == 'Y' ? true : false}">
						<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">设置支付商：</label>
				<div class="col-sm-8">
					<select style="width: 100%;height: 36px; border: 1px solid #ddd;" name="payerUserId">
						<option value=""></option>
						<option th:each="user:${payers}" th:value="${user.userId}" th:text="${user.userName}" th:field="*{payerUserId}"></option>
					</select>
				</div>
			</div>
		</form>
    </div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "channel/channelRate";
		$("#form-channelRate-edit").validate({
			rules:{
				xxxx:{
					required:true,
				},
			},
			focusCleanup: true
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/edit", $('#form-channelRate-edit').serialize());
	        }
	    }
	</script>
</body>
</html>
